<style>
    @media screen and (max-width: 500px) {
        .layui-table-view {
            width: 100% !important;
            overflow-x: scroll !important;
            left: 0 !important;
        }

        .layui-table-box {
            width:1000px !important;
            box-sizing: border-box;
        }
    }
</style>
<form class="layui-form seller-form" action="">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label seller-inline-2">手机号码：</label>
            <div class="layui-input-inline">
                <input type="text" name="mobile" value = "{$mobile}" lay-verify="title" placeholder="请输入完整手机号码" autocomplete="off"
                    class="layui-input">
                <input type="hidden" id="user_id" value="{$user_id}">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">类型：</label>
            <div class="layui-input-inline">
                <select name="type" lay-verify="">
                    <option value=""></option>
                    <option value="1">消费</option>
                    <!-- <option value="3">退款</option> -->
                    <option value="3">充值</option>
                    <option value="7">平台调整</option>
                    <!-- <option value="1">消费</option>
                    <option value="2">清算</option>
                    <option value="3">退款</option>
                    <option value="4">清算退款</option>
                    <option value="5">充值</option>
                    <option value="6">提现</option> -->
                </select>
            </div>
        </div>

        <div class="layui-inline">
            <button class="layui-btn layui-btn-sm" lay-submit lay-filter="*"><i
                    class="iconfont icon-chaxun"></i>筛选</button>
        </div>
    </div>
</form>

<div class="table-body">
    <table id="balanceTable" lay-filter="balanceTable"></table>
</div>

<script>
    layui.use(['form', 'layedit', 'laydate', 'table'], function () {

        layui.table.render({
            elem: '#balanceTable',
            height: 'full-115',
            cellMinWidth: '80',
            page: 'true',
            limit: '20',
            user_id: 33,
            url: "{:url('balance/index')}?_ajax=1&user_id=" + $('#user_id').val(),
            id: 'balanceTable',
            cols: [[
                { type: 'numbers' },
                {
                    field: 'mobile', width: 140, title: '用户', align: 'center', templet: function (data) {
                        var html = '';
                        html += data.mobile;
                        return html;
                    }
                },
                { field: 'type', align: 'center', width: 100, title: '类型' },
                { field: 'money', align: 'center', width: 120, title: '充值金额' },
                { field: 'balance', align: 'center', width: 120, title: '账户余额' },
                { field: 'gift', align: 'center', width: 140, title: '充值赠送金额' },
                { field: 'bindingbalance', align: 'center', width: 140, title: '账户赠送余额' },
                { field: 'memo', align: 'center', title: '描述', width: 400},
                { field: 'ctime', align: 'center', width: 200, title: '时间' }
            ]]
        });
        layui.form.on('submit(*)', function (data) {
            layui.table.reload('balanceTable', {
                where: data.field
                , page: {
                    curr: 1 //重新从第 1 页开始
                }
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });
</script>